feat: add gcloud utility to enable Service Usage API org-wide#994
Open
bob-bot wants to merge 4 commits into
Open
feat: add gcloud utility to enable Service Usage API org-wide#994bob-bot wants to merge 4 commits into
bob-bot wants to merge 4 commits into
Conversation
Adds a shell utility that lists all projects under a GCP organization and enables serviceusage.googleapis.com on each. Dry-run by default; pass --dry-run false to apply. Follows the existing shell_utils conventions ([INFO]/[ERROR] logging, dependency check, --help). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CDDFT1aHLHzV2eSynthEZH
The parent.id filter only returned projects whose direct parent was the org, missing folder-nested ones. Walk the org's folder tree (folders only, no Cloud Asset API) and filter the project list locally by parent id so projects at any depth are covered. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CDDFT1aHLHzV2eSynthEZH
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CDDFT1aHLHzV2eSynthEZH
gcloud services enable accepts multiple services in one call, so --service now takes a comma-separated list (e.g. serviceusage.googleapis.com,orgpolicy.googleapis.com). Docs and examples updated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CDDFT1aHLHzV2eSynthEZH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
guardrails_utilities/shell_utils/enable-serviceusage/— a shell utility that lists every project under a GCP organization and enables the Service Usage API (serviceusage.googleapis.com) on each one.Behavior
--dry-run falseto actually enable the service.--org-id(required),--service(defaultserviceusage.googleapis.com),--skip-system(skip non-ACTIVEprojects),--help.shell_utilsconventions:[INFO]/[ERROR]logging,gcloud/jqdependency check, argument parser, summary counts.Notes
parent.idfilter, which returns projects whose direct parent is the org. The script warns when that returns nothing (projects nested in folders); the README documents thegcloud asset search-all-resourcesalternative for a full org-wide sweep.🤖 Generated with Claude Code